/* 单行文本溢出省略号 */
@mixin text-ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 多行文本溢出省略号 */
@mixin multi-line-ellipsis($lines: 2) {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: $lines;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 清除浮动 */
@mixin clearfix {
  &::after {
    content: '';
    display: table;
    clear: both;
  }
}

/* 绝对定位居中 */
@mixin absolute-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* 水平方向绝对定位居中 */
@mixin absolute-center-x {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

/* 垂直方向绝对定位居中 */
@mixin absolute-center-y {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}

/* flex布局居中 */
@mixin flex-center {
  display: flex;
  justify-content: center;
  align-items: center;
}

/* flex布局水平居中 */
@mixin flex-center-x {
  display: flex;
  justify-content: center;
}

/* flex布局垂直居中 */
@mixin flex-center-y {
  display: flex;
  align-items: center;
}

/* 禁止用户选择 */
@mixin no-select {
  -webkit-user-select: none;
  user-select: none;
}

/* 设置滚动条样式 */
@mixin custom-scrollbar($width: 6rpx, $color: rgba(0, 0, 0, 0.3)) {
  &::-webkit-scrollbar {
    width: $width;
    height: $width;
  }
  
  &::-webkit-scrollbar-thumb {
    background-color: $color;
    border-radius: 3rpx;
  }
  
  &::-webkit-scrollbar-track {
    background-color: transparent;
  }
}

/* 设置边框 */
@mixin border($direction: all, $width: 1rpx, $style: solid, $color: $border-color-base) {
  @if $direction == all {
    border: $width $style $color;
  } @else {
    border-#{$direction}: $width $style $color;
  }
}

/* 设置阴影 */
@mixin box-shadow($shadow: $box-shadow-base) {
  box-shadow: $shadow;
}

/* 设置过渡 */
@mixin transition($property: all, $duration: $transition-duration-base, $timing-function: $transition-timing-function-base) {
  transition: $property $duration $timing-function;
} 